﻿using System;
using System.Collections.Generic;
using Model_SSResourceManager;
using Presenter_SSResourceManager;

namespace WebView_SSResourceManager
{
    public partial class ResourcesView : System.Web.UI.Page, IViewResources
    {
        private PresenterResourcesView _resourcesViewPresenter;

        protected void Page_Load(object sender, EventArgs e)
        {
            _resourcesViewPresenter = new PresenterResourcesView(this);
            _resourcesViewPresenter.Refresh(chB_ShowActive.Checked);
        }

        protected void BtnRefreshListClick(object sender, EventArgs e)
        {
            //refresh logic is redundant because Page_Load already do this
        }

        public void ShowResourcesList(IEnumerable<Resource> resources)
        {
            lstV_ResourcesView.DataSource = resources;
            lstV_ResourcesView.DataBind();
        }
    }

   
}